package com.item.mapper;

import com.item.pojo.Result;
import com.item.pojo.Role;
import com.item.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface usermapper {


    @Select("select * from users where username=#{username}")
User getusername(String username);



@Insert("INSERT INTO users(username, password, age, address, sex, phone, id_card, email, create_time, update_time) " +
            "VALUES (#{username}, #{password}, #{age}, #{address}, #{sex}, #{phone}, #{idCard}, #{email}, now(), now())")
    void register(@Param("username") String username,
                  @Param("password") String password,
                  @Param("age") int age,
                  @Param("address") String address,
                  @Param("sex") String sex,
                  @Param("phone") String phone,
                  @Param("idCard") String idCard,
                  @Param("email") String email);

};





